import { RouteNamedMap } from 'vue-router/auto/routes';
import Router from '@/router';
import { type RouteLocationRaw } from 'vue-router/auto';
/**
 * 跳转到指定路径
 * @param to - 路径字符串或对象
 * @returns 无
 */
export async function routerPush(to: RouteLocationRaw) {
  await Router.push(to);
}

/**
 * 通过路由名称进行路由跳转
 *
 * @param {keyof RouteNamedMap} routeName - 要跳转的路由名称
 */
export async function routerPushByRouteName(routeName: keyof RouteNamedMap) {
  await Router.push({ name: routeName });
}
